<ul id="main-nav-menu" class="navbar-nav d-flex">
  <%= render_list_items do |li|
    li << link_to(t("menu.topics"), Setting.has_module?(:home) ? main_app.topics_path : main_app.root_path, class: "nav-link")
    li << link_to(t("menu.bugs"), main_app.bugs_path, class: "nav-link") if Setting.has_module?(:bug)
    li << link_to(t("menu.questions"), main_app.questions_path, class: "nav-link") if Setting.has_module?(:question)
    li << link_to(t("menu.teams"), main_app.teams_path, class: "nav-link") if Setting.has_module?(:team)
    li << link_to(t("menu.column_channel"), main_app.column_channels_path, class: "nav-link") if Setting.has_module?(:column_channels)
    li << link_to(t("menu.credit_products"), main_app.credit_products_path, class: "nav-link") if Setting.has_module?(:credit_products)

    new_tags = (Setting.new_tags || "").split("\n").collect(&:strip)

    Homeland.navbar_plugins.each do |plugin|
      if Setting.has_module?(plugin.name)
        if plugin.name.strip.in?(new_tags)
          li << link_to(sanitize(plugin.display_name + content_tag(:span,"新",class:"new-tag badge badge-danger")), plugin.root_path, class: "nav-link")
        else
          li << link_to(plugin.display_name, plugin.root_path, class: "nav-link")
        end
      end
    end
  end %>
  <%= raw Setting.navbar_html %>
</ul>
